home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / hlvector.lha / hl_vector / vali.dat < prev    next >
Text File  |  1993-08-08  |  3KB  |  121 lines

  1.  
  2.  
  3.         Verification of the Aitken-Lagrange interpolation
  4.  
  5. ------------- Interpolation over the table with uniform grid
  6. Function to interpolate: exp(-x)
  7.  
  8. Check to see that interpolation at a node gives an exact result
  9.  
  10. Uniform grid [0.1:1] with the step 0.1
  11. Done
  12.  
  13. Check the precision of the interpolation at arbitrary points
  14.  
  15. Uniform grid [0.1:1] with the step 0.1
  16. Point    Exact function value     Interpolated    Error
  17.    0               1            0.999998   1.72853e-06
  18. 0.11        0.895834            0.895834   1.26336e-08
  19. 0.22        0.802519            0.802519   1.29626e-08
  20. 0.33        0.718924            0.718924   1.41076e-08
  21. 0.44        0.644036            0.644036   8.84407e-09
  22. 0.55         0.57695             0.57695   1.43652e-07
  23. 0.66        0.516851            0.516851   3.10746e-08
  24. 0.77        0.463013            0.463013   1.53709e-08
  25. 0.88        0.414783            0.414783   8.92645e-08
  26. 0.99        0.371577            0.371576   4.41423e-07
  27.  1.1        0.332871            0.332871   2.12869e-07
  28.  
  29. Done
  30.  
  31. Grids 0.1 .. 1 have the mesh 0.1, and 1..9 have the mesh 0.2
  32.  
  33. Check to see that interpolation at a node gives an exact result
  34.  
  35. Done
  36.  
  37. Check the precision of the interpolation at arbitrary points
  38.  
  39. Point    Exact function value     Interpolated    Error
  40.    0               0         8.51708e-07   8.51708e-07
  41. 0.27        0.259626            0.259626   1.14471e-08
  42. 0.54        0.487109            0.487109   3.00486e-08
  43. 0.81        0.667933            0.667933   1.61806e-08
  44.  1.1         0.79167             0.79167   6.00246e-08
  45.  1.4        0.852505            0.852481   2.41944e-05
  46.  1.6        0.849412            0.849412    1.1897e-08
  47.  1.9        0.785971            0.785972   1.42046e-07
  48.  2.2        0.669875            0.669875   9.72032e-08
  49.  2.4        0.512161            0.512161   3.90728e-09
  50.  2.7        0.326253            0.326253   1.96635e-08
  51.    3        0.126876            0.126876   2.32042e-08
  52.  3.2      -0.0710583          -0.0710583    2.1131e-08
  53.  3.5       -0.253526           -0.253526   2.44474e-08
  54.  3.8       -0.408341            -0.40834   1.73721e-07
  55.  
  56. Done
  57.  
  58. Check the precision of the interpolation at arbitrary points
  59.  
  60. Example from Fig. 4.11 of the book
  61.     Numerical Methods and Software,
  62.     by D.Kahaner, C.Moler, and S.Nash - Prentice Hall, 1989
  63.  
  64.         Interpolation nots
  65. x      0      2      3      5      6      8      9     11     12     14     15 
  66. y     10     10     10     10     10     10     11     15     50     60     85 
  67.  
  68. Point    Interpolated value
  69.       0             10
  70.    0.32             10
  71.    0.64             10
  72.    0.96             10
  73.    1.28             10
  74.     1.6             10
  75.    1.92             10
  76.    2.24             10
  77.    2.56             10
  78.    2.88             10
  79.     3.2             10
  80.    3.52             10
  81.    3.84             10
  82.    4.16             10
  83.    4.48             10
  84.     4.8             10
  85.    5.12             10
  86.    5.44             10
  87.    5.76             10
  88.    6.08             10
  89.     6.4             10
  90.    6.72             10
  91.    7.04        9.94286
  92.    7.36        9.93781
  93.    7.68        9.95318
  94.       8             10
  95.    8.32        10.0911
  96.    8.64        10.2309
  97.    8.96        10.4641
  98.    9.28        10.2771
  99.     9.6          9.232
  100.    9.92        8.71549
  101.   10.24        5.79377
  102.   10.56        9.07021
  103.   10.88        12.9199
  104.    11.2        20.6143
  105.   11.52         29.442
  106.   11.84        42.5424
  107.   12.16        57.7971
  108.   12.48        73.2555
  109.    12.8        86.0643
  110.   13.12        62.2166
  111.   13.44        61.3373
  112.   13.76        60.1782
  113.   14.08        60.8715
  114.    14.4             66
  115.   14.72        74.3712
  116.   15.04        86.8043
  117.   15.36        104.118
  118.   15.68        127.133
  119.  
  120. Done
  121.